/*-----------------------------------------------------------------------------
* @Description:     活动报名信息个人详情
* @Version:         1.0.0
* @author:          xuexy(915585955@qq.com)
* @date             2017.11.14
* ==NOTES:=============================================
* v1.0.0(2017.11.14):
     初始生成
* ---------------------------------------------------------------------------*/

$(function(){

	sendId();

	function sendId(){
        var id = $('.hidId').val(),
            record = $('.recordId').val();

        $.ajax({
            type: jQuery.url.InformationRegisterManagement.personalInfo.type,
            url: jQuery.url.InformationRegisterManagement.personalInfo.url,
            contentType: "application/x-www-form-urlencoded; charset=utf-8",
            data: {
               id: id,
               recordId: record
            },     //JSON.stringify
            dataType: "json",
            success: function (rs) {
                if( rs.code == 0){ 
                    detailData(rs);//详情页刷数据
                }else{
                	Alert('提示信息', '操作失败，返回参数不正确!');
                }
            },
            error: function (message) {
                Alert('提示信息', '请求发送失败。');
            }
        });
	};


	function detailData(rs){
		var str = '';

        $.each(rs.list, function(index, item){
            str += '<div class="form-group">\
                		<label class="col-sm-5 control-label">'+item.title+' :</label>\
                		<div class="col-sm-5">';
            if(item.type == 6){
                str += '<img src="'+item.content+'">\
                        </div>\
                    </div>';
            }else{
                str += '<input readonly class="new500  border0" type="text"  value="'+item.content+'"/>\
                        </div>\
                    </div>';
            }
        });
        $('.panel-body').prepend(str);
	};
});
